<?php
namespace app\manager\controller;
use think\Controller;
use think\Session;
use think\Request;
use app\common\traits\controller\TraitUpload;
/**
 * 营地现金管理
 */
class Cash extends BaseController
{   
    //use \app\common\traits\controller\TraitController;
    use TraitUpload;
    // //登陆判断
    // protected $beforeActionList = [
    //     'checkLogin',
        
    // ];
    // protected function checkLogin()
    // {
    //     if (!model('Managers')->checkLogin()) {
    //         $this->redirect('@manager/login');
    //         exit;
    //     }
    // }
    /**
     * [FunctionName 现金列表]
     * @param string $value [description]
     */
    public function getList()
    {
      //取登陆人营地id、取本公司下的营地
      // $id = session('manager.id');
      // $camp_id = model('CampManagers')->where('id',$id)->value('camp_id');
      // //取本营地下的现金流水信息
      // $list = model('Cashs')->setPageSize(15)->getCashsList(array_merge(input('get.'),['camp_id'=>$camp_id]));
      // return view('cash/index',['list'=>$list]);

      $user_id = session('manager.id');
      $camp_id = model('CampManagers')->where('id',$user_id)->value('camp_id');
      $list = model('common/CapitalDetails')->getBlanceDetailLists(array_merge(input('get.'), ['camp_id' => $camp_id]), $order = 'updated_at desc');
          $this->assign('list',$list);

      return view('cash/index');
    
    }

}
